<!--
 * @Author: 温州市宅龙网络科技有限公司
 * @email: 
 * @github:https://gitee.com/yourking/outstanding-human-social-mall 
 * @LastEditors: 温州市宅龙网络科技有限公司
 * @Description: 杰出人类商城项目
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>公众号支付</title>
</head>
<body>
    <script>
        function onBridgeReady() {
            WeixinJSBridge.invoke('getBrandWCPayRequest', {
                "appId": "{$appId}",     //公众号ID，由商户传入     
                "timeStamp": "{$timeStamp}",     //时间戳，自1970年以来的秒数     
                "nonceStr": "{$nonceStr}",      //随机串     
                "package": "{$package}",
                "signType": "{$signType}",     //微信签名方式：     
                "paySign": "{$paySign}" //微信签名 
            },
            function(res) {
                if (res.err_msg == "get_brand_wcpay_request:ok") {
                    // 使用以上方式判断前端返回,微信团队郑重提示：
                    //res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠。
                }
            });
            location.href = '/pages/user/recharge/index';
        }
        if (typeof WeixinJSBridge == "undefined") {
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        } else {
            onBridgeReady();
        }
    </script>
</body>
</html>